package com.liyunhan.StrassenAlgorithm;

import java.util.ArrayList;

/**
 * @Description: Simple 矩阵乘法
 * @Author: Liyunhan
 * @Date: 2021/11/15 21:25
 */
public class MatrixProduct extends CalExecTimeAbs {

    public MatrixProduct(int n, double[][] matrix1, double[][] matrix2) {
        super(n, matrix1, matrix2);
    }

    /**
     * 经典矩阵乘法
     */
    @Override
    public void execAlgorithm() {
        for (int i = 0; i < this.getN(); i++) {
            for (int j = 0; j < this.getN(); j++) {
                for (int k = 0; k < this.getN(); k++) {
                    this.getResMatrix()[i][j] += this.getMatrix1()[i][k] * this.getMatrix2()[k][j];
                }
            }
        }
    }
}
